import type {
  TeacherAddDTOType,
  TeacherUpdateDTOType,
  TeacherSearchDTOType,
} from '@/resources/interface/teacher/TeacherTypes'
import type { TableColumn } from '@/components/CommonTable.vue'
import { ComponentEnum, type FormItemConfig } from '@/components/CommonDialogForm.vue'

/**
 * 教师表 参数对象
 */
export class TeacherParams {
  /**
   * 表单参数
   */
  static formColumn: FormItemConfig[] = [
    {
      label: '工号',
      prop: 'employeeNumber',
      type: ComponentEnum.INPUT,
      field: 'employeeNumber',
    },
    {
      label: '教师名称',
      prop: 'name',
      type: ComponentEnum.INPUT,
      field: 'name',
    },
    {
      label: '职称（如教授）',
      prop: 'title',
      type: ComponentEnum.INPUT,
      field: 'title',
    },
    {
      label: '所属院系',
      prop: 'department',
      type: ComponentEnum.INPUT,
      field: 'department',
    },
    {
      label: '职位（如系主任）',
      prop: 'position',
      type: ComponentEnum.INPUT,
      field: 'position',
    }

  ]
  /**
   * 表格参数
   */
  static tableColumn: TableColumn[] = [
    {
      label: '工号',
      field: 'employeeNumber',
    },
    {
      label: '教师名称',
      field: 'name',
    },
    {
      label: '职称（如教授）',
      field: 'title',
    },
    {
      label: '所属院系',
      field: 'department',
    },
    {
      label: '职位（如系主任）',
      field: 'position',
    },

    {
      label: '操作',
      field: 'right',
      attribute: {
        fixed: 'right',
        width: '200px',
      },
      template: {
        options: [
          {
            icon: 'edit',
            type: 'primary',
            size: 'small',
            method: 'update',
          },
          {
            icon: 'delete',
            type: 'danger',
            size: 'small',
            method: 'remove',
          },
        ],
      },
    },
  ]
  /**
   * 添加对象
   */
  static addDTO: TeacherAddDTOType = {
    userId: '',
    employeeNumber: '',
    title: '',
    department: '',
    position: '',
    name: '',
  }
  /**
   * 修改对象
   */
  static updateDTO: TeacherUpdateDTOType = {
    id: 0,
    userId: '',
    employeeNumber: '',
    title: '',
    department: '',
    position: '',
    name: '',
  }
  /**
   * 查询对象
   */
  static searchDTO: TeacherSearchDTOType = {
    name: '',
    page: {
      current: 1,
      size: 20,
    },
  }
}
